package com.hongyun.tms.common.dto.prodplan;

import com.google.api.client.util.Lists;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.*;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;

/**
 * 作业计划 新增参数
 *
 * @author liPeng
 * @date 2024-05-31
 **/
@Data
public class ProPlanSaveReqDto implements Serializable {

    @ApiModelProperty(value = "主键")
    private Long id;

    @ApiModelProperty(value = "船舶ID")
    @NotNull(message = "船舶不能为空")
    private Long shipId;

    @ApiModelProperty(value = "船名")
    @NotBlank(message = "船舶名不能为空")
    @Size(max = 20, message = "船舶名字不能超过20个字符")
    private String shipName;

    @ApiModelProperty(value = "码头ID")
    @NotNull(message = "码头ID不能为空")
    private Long dockId;


    @ApiModelProperty(value = "贸别：内贸，外贸")
    @NotBlank(message = "贸别不能为空")
    @Size(max = 5, message = "贸易类别不能超过5个字符")
    private String tradeType;

    @ApiModelProperty(value = "装卸：装，卸")
    @NotBlank(message = "装卸类型不能为空")
    @Size(max = 5, message = "装卸类型不能超过5个字符")
    private String loadUnload;

    @ApiModelProperty(value = "泊位")
    @NotBlank(message = "泊位不能为空")
    @Size(max = 10, message = "泊位不能超过10个字符")
    private String berthNo;

    @ApiModelProperty(value = "计划作业时间")
    @NotBlank(message = "计划作业时间不能为空")
    @Size(max = 20, message = "计划作业时间不能超过20个字符")
    private String planTime;

    @ApiModelProperty(value = "前吃水")
    private BigDecimal frontDraft;

    @ApiModelProperty(value = "后吃水")
    private BigDecimal rearDraft;

    @ApiModelProperty(value = "客户ID")
    @NotNull(message = "客户ID不能为空")
    private Long customerId;

    @ApiModelProperty(value = "客户名称")
    private String customerName;

    @ApiModelProperty(value = "进出，进，出")
    private String inOut;

    @ApiModelProperty(value = "货名")
    @NotBlank(message = "货名不能为空")
    @Size(max = 30, message = "货名不能超过30个字符")
    private String cargoName;

    @ApiModelProperty(value = "货重")
    @NotNull(message = "货重不能为空")
    @DecimalMin(value = "0.00", message = "货重不能小于0.00")
    @DecimalMax(value = "99999.99", message = "货重不能大于99999.99")
    private BigDecimal ton;

    @ApiModelProperty(value = "备注")
    @Size(max = 200, message = "备注不能超过200个字符")
    private String remark;

    @ApiModelProperty(value = "0待审1已审")
    @NotNull(message = "审核状态不能为空")
    private Integer status;

    @ApiModelProperty(value = "作业港区代码,字典")
    @NotBlank(message = "作业港区不能为空")
    @Size(max = 30, message = "作业港区不能超过30个字符")
    private String portAreaCode;

    @ApiModelProperty(value = "作业港区名称")
    private String portAreaName;

    @ApiModelProperty(value = "航次")
    @NotBlank(message = "航次不能为空")
    @Size(max = 10, message = "航次不能超过10个字符")
    private String voyage;

    @ApiModelProperty(value = "作业单位")
    private String corp;

    //作业计划关联的作业记录列表
    @ApiModelProperty(value = "作业计划关联的作业记录列表")
    private List<PlanTugInfo> children = Lists.newArrayList();

    @ApiModel(value = "作业计划关联的作业记录")
    @Data
    public static class PlanTugInfo {

        @ApiModelProperty(value = "拖轮ID")
        private Long tugId;

        @ApiModelProperty(value = "拖轮编号")
        private String tugNo;

        @ApiModelProperty(value = "作业项目ID")
        private Long workItemId;

        @ApiModelProperty(value = "作业项目名称")
        private String workItemName;
    }
}

